﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;

namespace WebStudio.Framework.Helper
{
    public static class ExceptionHelper
    {
        //方法

        public static void Handle(Exception objExp)
        {
            Handle(objExp, "Global Policy");
        }

        public static void Handle(Exception objExp, IDictionary<string, object> properties)
        {
            Handle(objExp);
            LoggerHelper.WriteError("异常相关属性", "异常相关属性", properties);
        }

        public static void Handle(Exception objExp, string policyName)
        {
            ExceptionPolicy.HandleException(objExp, policyName);
        }

        public static void Handle(Exception objExp, IDictionary<string, object> properties, string policyName)
        {
            ExceptionPolicy.HandleException(objExp, policyName);
            LoggerHelper.WriteError("异常相关属性", "异常相关属性", properties);
        }
    }


}
